package crm.sfh.server;

import cn.bmob.v3.BmobObject;
import crm.sfh.server.entity.ENotice;

/**
 * 功能描述:
 *
 * @date 2018/6/7
 */
public class SNotice extends BmobObject {
    SUser fromUser;
    SUser toUser;

    String giftName;
    String giftUrl;
    /**
     * 0 普通 1 特效 2土豪 3奢侈
     */
    String giftType;
    /**
     * 增加魅力值
     */
    int giftCharm;

    public SUser getFromUser() {
        return fromUser;
    }

    public SUser getToUser() {
        return toUser;
    }

    public String getGiftName() {
        return giftName;
    }

    public String getGiftUrl() {
        return giftUrl;
    }

    public String getGiftType() {
        return giftType;
    }

    public int getGiftCharm() {
        return giftCharm;
    }

    public ENotice getENotice(){
        ENotice notice = new ENotice();
        notice.setCreateTime(getCreatedAt());
        notice.setFromUserHead(fromUser.getUrl());
        notice.setFromUserName(fromUser.getName());
        notice.setFromUserId(fromUser.getObjectId());

        notice.setToUserHead(toUser.getUrl());
        notice.setToUserName(toUser.getName());
        notice.setToUserId(toUser.getObjectId());

        notice.setGiftCharm(giftCharm);
        notice.setGiftName(giftName);
        notice.setGiftType(giftType);
        notice.setGiftUrl(giftUrl);
        return notice;
    }
}
